package com.liangwj.springbootdesignpatterns.createTypePatterns.ProtoType;

import java.util.ArrayList;
import java.util.List;

/**
 * <b>Description:</b> 客户角色:BenzEmailClient <br/>
 * @author Lingwenjun
 * @date 2019/1/22-18:08
 * @version 1.0
 */
public class BenzEmailClient {
    //要发送的收件人的集合
    private List<String> receList = new ArrayList<>();

    /**
     * 在集合中添加收件人
     * @return
     */
    public List<String> getEmailList() {
        receList.add("a1");
        receList.add("a2");
        receList.add("a3");
        return receList;
    }

    /**
     * 发送邮件的方法(模拟发送)
     * @param emailObject
     */
    public void sendEmail(EmailObject emailObject) {
        System.out.println("发送邮件给:" + emailObject.getReceiver());
        System.out.println("邮件标题:" + emailObject.getTitle());
        System.out.println("邮件内容:" + emailObject.getContext());
    }
}
